<include file="Public/header"/>
<body class="body-bg">
<div class="park-header">
    <div class="park-header__title">账户充值</div>
    <div class="park-header__left park-back">
        <i class="iconfont icon-fanhui"></i>
    </div>
</div>
<div class="container">
    <div class="transaction-block">
        <div class="transaction-type">
            <span class="title">支付方式（必选）</span>
        </div>
        <div class="transaction-list">
            <div class="transaction-item">
                <div class="transaction-item__title"><i class="park-wechat-icon"></i>&nbsp;&nbsp;微信支付</div>
                <label class="park-form">
                    <input class="park-form__radio" type="radio" name="" checked>
                    <span class="park-form__radioInput"></span>
                </label>
            </div>
        </div>
    </div>
    <div class="transaction-block">
        <div class="transaction-type">
            <span class="title">充值金额</span>
        </div>
        <div class="transaction-input">
            <input type="number" id="price" placeholder="请输入金额" onkeyup="this.value = this.value.replace(/[^\d.]/g, '')" onpaste="this.value=this.value.replace(/[^\d.]/g,'')">
        </div>
    </div>
    <div class="park-btn park-btn-bottom park-btn-default mt-footer__btn" onClick="sub_price();">下一步</div>
</div>
<form id="pay" action="http://tqr.frontpay.cn/sinochem/order/comfirmpay" method="post">
    <input type="hidden" name="token" id="token">
</form>
</body>
<script src="__ROOT__/Public/Home/layer/layer.js"></script>
<script>
	function sub_price(){
		var price = $('#price').val();
		if(!price){
			layer.open({
				content:'请输入金额'
				,skin: 'msg'
				,time: 2 //2秒后自动关闭
			});
		}
		$.post('/Home/User/recharge/',{act:'ajax',price:price},function(data){
			if(data.code==200){
				$('#token').val(data.result);
				$('#pay').submit();
			}else{
				layer.open({
					content:data.msg
					,skin: 'msg'
					,time: 2 //2秒后自动关闭
				});
			}
		},'json');
	}
</script>
</html>